package com.study.common.security;

import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.util.Date;

@SuppressWarnings("all")
public class KeyRepository {

	private RSAPublicKey publicKey;

	private RSAPrivateKey privateKey;

	private Date generateDate;
	
	private String uk;
	
	public RSAPublicKey getPublicKey() {
		return publicKey;
	}

	public void setPublicKey(RSAPublicKey publicKey) {
		this.publicKey = publicKey;
	}

	public RSAPrivateKey getPrivateKey() {
		return privateKey;
	}

	public void setPrivateKey(RSAPrivateKey privateKey) {
		this.privateKey = privateKey;
	}

	public Date getGenerateDate() {
		return generateDate;
	}

	public void setGenerateDate(Date generateDate) {
		this.generateDate = generateDate;
	}

	public String getModulus() {
		if(publicKey==null){
			return "";
		} 
		return publicKey.getModulus().toString(16);  
	}

	public String getExponent() {
		if(publicKey==null){
			return "";
		}
		return publicKey.getPublicExponent().toString(16);  
	}

	public String getUk() {
		return uk;
	}

	public void setUk(String uk) {
		this.uk = uk;
	}

}